package com.qiyeji.real_estate.service;

import com.qiyeji.real_estate.entity.TemporaryWorkKey;
import com.qiyeji.real_estate.entity.workKey;
import com.qiyeji.real_estate.mapper.TemporaryWorkMapper;
import com.qiyeji.real_estate.mapper.workMapper;
import org.camunda.feel.syntaxtree.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkService {
    @Autowired
    workMapper workMapper;

    @Autowired
    TemporaryWorkMapper temporaryWorkMapper;

    public int insert(workKey record){
        return workMapper.insert(record);
    }

    public int delete(workKey key){
        return workMapper.deleteByPrimaryKey(key);
    }

    public List<workKey> getAllWorkKey(){
        return workMapper.getAllWorkKey();
    }

    public List<workKey> fuzzyQuery(String key){
        return workMapper.fuzzyQuery(key);
    }

    public int insert(TemporaryWorkKey record) { return temporaryWorkMapper.insertSelective(record); }

    public int delete(TemporaryWorkKey record) { return  temporaryWorkMapper.deleteByPrimaryKey(record); }

    public List<TemporaryWorkKey> fuzzyQuery1(String key) { return temporaryWorkMapper.fuzzyQuery(key); }

    public int update(TemporaryWorkKey record) { return temporaryWorkMapper.update(record); }

    public int updateAll(TemporaryWorkKey record) { return temporaryWorkMapper.updateAll(record); }

    public TemporaryWorkKey select(String pCode) { return temporaryWorkMapper.select(pCode); }

    public int deleteByPCode(String pCode) { return temporaryWorkMapper.delete(pCode); }

    public List<String> getMembersByPCode(String pCode) { return workMapper.getMembersByPCode(pCode); }

    public List<String> getMembersBypCode(String pCode) { return temporaryWorkMapper.getMembersByPCode(pCode); }

    public TemporaryWorkKey selectForParentTaskID(String sCode, String pCode){
        return temporaryWorkMapper.selectForParentTaskID(sCode, pCode);
    }

    public Integer delete1(String pCode, String sCode) {
        return workMapper.delete(pCode, sCode);
    }

    public List<String> select(String pCode, String dCode){
        return workMapper.select(dCode, pCode);
    }

}
